class Solution(object):
    def countVowels(self, word):
        ans = 0
        n = len(word)
        base = 10 ** 9 + 7
        for index, c in enumerate(word):
            if c in {'a', 'e', 'i', 'o', 'u'}:
                ans = (ans + (index + 1) * (n - index)) % base
        return ans
